package com.flying.oop_demo1;

/**
 * @author 刘鹏飞
 * @ClassName Point
 * @Date 2024/12/2 22:53
 * @Created by 刘鹏飞
 * @Description 测试构造方法
 */
public class Point {
    public double x;
    public double y;

    // 有参的构造器，会覆盖默认的无参构造器
    public Point(double x,double y){
        this.x=x;
        this.y=y;
    }



    public double length(Point p){
        return Math.sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
    }

}
